//
//  BlackListTableViewCell.m
//  AAIM
//
//  Created by 远的小布丁 on 2019/12/5.
//  Copyright © 2019 AAIM. All rights reserved.
//

#import "BlackListTableViewCell.h"

@implementation BlackListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];

    // Initialization code
    // Initialization code
}

- (void)setShowUI{
    [self.contentView addSubview:self.line];
    [self.line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(SCALAE_WIDTH(15));
        make.bottom.equalTo(self.mas_bottom);
        make.height.offset(0.5);
        make.right.equalTo(self.mas_right).offset(SCALAE_WIDTH(-15));
    }];
    self.nameLabel.textColor=KHEXCOLOR(kBlackColor);
    self.headerImageView.backgroundColor=[UIColor redColor];
     [_statuBtn setBackgroundImage:[UIImage imageNamed:@"打钩"] forState:UIControlStateSelected];
    [_statuBtn setBackgroundImage:[UIImage imageNamed:@"未选中打钩"] forState:UIControlStateNormal];
    [self.headerImageView configLayerWithBorderWidth:0 andWithCornerRadius:18 andWithBorderColor:[UIColor clearColor]];
}
-(void)setContactor:(ContactModel *)contactor
{
//    [_headerImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",userHeaderImage,contactor.head]] placeholderImage:[UIImage imageNamed:@"default_user"]];
  [_headerImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",userHeaderImage,contactor.head]] placeholderImage:[UIImage imageNamed:@"bg_pyqtx"] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  KWeakSelf;
  weakSelf.headerImageView.image = image;
  }];
    _nameLabel.text = contactor.nickname;
    
    _statuBtn.selected = contactor.seleoctedState;
}
- (IBAction)changeStatuActive:(UIButton *)sender {
    sender.selected = !sender.selected;

    if (self.delegate) {
        [self.delegate changeRightBtnStatus:sender];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
